﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<B10.Models.PageListViewModel>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
</asp:Content>
<asp:Content ID="indexHeader" ContentPlaceHolderID="HeaderContent" runat="server">
</asp:Content>
<asp:Content ID="indexContent" ContentPlaceHolderID="MainContent" runat="server">
    <h2>
        Panel Administracyjny</h2>
    <div>
        <ol class="page-list">
            <%
                foreach (var page in Model.Pages)
                {
                    string categoryName = B10.Models.CategoryHelper.GetCategoryName(page.Category);
            %>
            <li class="page-list-item">
                <h2>
                    <%= Html.ActionLink(page.Title, "Page","Home", new { pageUrl = page.Url },null)%>
                </h2>
                <div class="descDiv">
                    <%= Html.Encode(page.Description)%>
                </div>
                <div class="adminDiv">
                    <%= Html.ActionLink("Akceptuj", "Command", new { command = "Accepted", pageID = page.Id })%>
                    <%= Html.ActionLink("Odrzuć", "Command", new { command = "Deny", pageID = page.Id })%>
                </div>
                <span class="metaInfo right">Data:
                    <%= Html.Encode(page.CreatedDate.ToShortDateString()) + " " + Html.Encode(page.CreatedDate.ToShortTimeString() + ";") %>
                    Autor:
                    <%= Html.ActionLink(page.UserProfile.DisplayName,"Index","Profile",new{name=page.UserProfile.DisplayName,id=page.ProfileId},null)%>;
                    Kategoria:
                    <%=Html.RouteLink(categoryName, "Categories", new { categoryName = categoryName, category = (int)page.Category, page = 0 }, null)%>
                </span>
                <div class="clear">
                </div>
            </li>
            <% } %>
        </ol>
    </div>
    <% Html.RenderPartial("PaginationControl", Model.Pages.ListInfo); %>
</asp:Content>
